package com.kkb.wx.service.impl;

import com.kkb.mapper.TWxMemberMapper;
import com.kkb.pojo.TWxMember;
import com.kkb.wx.service.WxMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;

@Service
/**
 * 微信会员业务实现类
 */
public class WxMemberServiceImpl implements WxMemberService {
    @Autowired
    private TWxMemberMapper wxMemberMapper;

    //根据openId,获取会员信息
    @Override
    public TWxMember findByOpenId(String openId) {
        TWxMember wxMember = wxMemberMapper.selectByOpenId(openId);
        return wxMember;
    }

    //新增会员
    @Override
    public int regWxMember(TWxMember wxMember) {
        int insert = wxMemberMapper.insert(wxMember);
        return insert;
    }

    @Override
    public int updateCityCourse(HashMap<String, String> data) {
        int result = wxMemberMapper.updateCityCourse(data);
        return result;
    }
}
